package cn.stylefeng.guns.sys.modular.system.controller;

import cn.stylefeng.guns.base.pojo.page.LayuiPageInfo;
import cn.stylefeng.guns.sys.modular.system.model.params.BtyReemployParam;
import cn.stylefeng.guns.sys.modular.system.service.BtyReemployService;
import cn.stylefeng.roses.core.base.controller.BaseController;
import cn.stylefeng.roses.core.reqres.response.ResponseData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Arrays;


/**
 * 再次入职人员控制层
 *
 * @author tz
 * @Date 2022-05-05
 */
@Controller
@RequestMapping("/btyReemploy")
public class BtyReemployController extends BaseController {

    private String PREFIX = "/modular/system/btyReemploy";

    @Autowired
    private BtyReemployService reemployService;

    /**
     * 跳转到主页面
     *
     * @author yxc
     * @Date 2021-05-13
     */
    @RequestMapping("")
    public String index() {
        return PREFIX + "/reemploy.html";
    }


    /**
     * 删除接口
     *
     * @Param reemployIds 再次入职员工集合
     */
    @RequestMapping("/batchdelete")
    @ResponseBody
    public ResponseData batchDelete(@RequestParam("reemployIds") String reemployIds) {
        this.reemployService.batchDelete(Arrays.asList(reemployIds.split(",")));
        return ResponseData.success();
    }

    /**
     * 查询列表
     *
     * @Param param 查询条件
     */
    @ResponseBody
    @RequestMapping("/list")
    public LayuiPageInfo list(BtyReemployParam param) {
        return this.reemployService.findPageBySpec(param);
    }

}


